package org.example.curriculum_design_6_16.entity.pojo;

import lombok.Data;
import java.io.Serializable;

@Data
public class UserRoleKey implements Serializable {
    private String userId;
    private String roleId;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UserRoleKey that = (UserRoleKey) o;

        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;
        return roleId != null ? roleId.equals(that.roleId) : that.roleId == null;
    }

    @Override
    public int hashCode() {
        int result = userId != null ? userId.hashCode() : 0;
        result = 31 * result + (roleId != null ? roleId.hashCode() : 0);
        return result;
    }
}